<?php echo $head ?>
    <div class="right-content">
        <div class="we7-page-title">
            入口设置
        </div>
        <ul class="we7-page-tab">
            <li class="active">封面链接入口</li>
        </ul>
        <div id="js-keyword-display" class="ng-scope">
            <div ng-controller="KeywordDisplay" class="ng-scope">
                <table class="table we7-table table-hover vertical-middle">
                    <colgroup>
                        <col width="150px">
                        <col width="">
                        <col width="250px">
                    </colgroup>
                    <tbody>
                    <tr>
                        <th>二维码</th>
                        <th class="text-left">入口名称</th>
                        <th class="text-right">操作</th>
                    </tr>
                    <?php foreach ($data as $k => $v) {
                        ?>
                        <tr>
                        <td data-size='100' class='js-url-qrcode'>
                            <div class='qrcode-block'>
                            宽高100二维码
                            </div>
                            <img src="http://apis.juhe.cn/qrcode/api?key=1b3f9a1d04ccfe902a5f51bfef46c694&type=2&fgcolor=000000&w=200&m=5&text=<?php echo urlencode($v['code_url'])?>" alt="">
                        </td>
                        <td class='text-left'><?php echo $v['name']?></td>
                        <td>
                            <div class='link-group' style='position:relative;'>
                                <a href='javascript:;'
                                   data-url='<?php echo $v['code_url']?>' id="code_url_<?php echo $k?>" style='margin-right:0px;' onclick='copyText(<?php echo $k?>)' class='color-default js-clip'>复制链接</a>
                            </div>
                        </td>
                    </tr>
                   <?php } ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
<?php echo $end ?>

<script>
    function copyText(k) {
        var text=$("#code_url_"+k).attr("data-url");
        var textarea = document.createElement("textarea");
        var currentFocus = document.activeElement;
        document.body.appendChild(textarea);
        textarea.value = text;
        textarea.focus();
        if (textarea.setSelectionRange)
            textarea.setSelectionRange(0, textarea.value.length);
        else
            textarea.select();
        try {
            var flag = document.execCommand("copy");
        } catch(eo){
            var flag = false;
        }
        document.body.removeChild(textarea);
        currentFocus.focus();
        return flag;
    }
</script>
